<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('消息列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <!--<li>-->
                            <!--<label>类型 1：文字；2：图片;3：音频；4：文件；5位置；：</label>-->
                            <!--<select name="msgType">-->
                                <!--<option value="">所有</option>-->
                                <!--<option value="-1">代码生成请选择字典属性</option>-->
                            <!--</select>-->
                        <!--</li>-->
                        <!--<li>-->
                            <!--<label>消息接收人登录名称：</label>-->
                            <!--<input type="text" name="toUserLoginName"/>-->
                        <!--</li>-->
                        <li>
                            <label>消息接收人名称：</label>
                            <input type="text" name="toUserName"/>
                        </li>
                        <li class="select-time">
                            <label>消息发送时间：</label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
                        </li>
                        <li>
                            <label>消息发送人登录名称：</label>
                            <input type="text" name="fromUserLoginName"/>
                        </li>
                        <!--<li>-->
                            <!--<label>发送者头像地址：</label>-->
                            <!--<input type="text" name="fromAvatar"/>-->
                        <!--</li>-->
                        <!--<li>-->
                            <!--<label>消息发送人名称：</label>-->
                            <!--<input type="text" name="fromUserName"/>-->
                        <!--</li>-->
                        <!--<li>-->
                            <!--<label>消息状态：0：未读；1：已读：</label>-->
                            <!--<select name="msgStatus">-->
                                <!--<option value="">所有</option>-->
                                <!--<option value="-1">代码生成请选择字典属性</option>-->
                            <!--</select>-->
                        <!--</li>-->
                        <!--<li>-->
                            <!--<label>录音时长：</label>-->
                            <!--<input type="text" name="voiceTime"/>-->
                        <!--</li>-->
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="eden-webscoket:message:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="eden-webscoket:message:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="eden-webscoket:message:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="eden-webscoket:message:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('eden-webscoket:message:edit')}]];
    var removeFlag = [[${@permission.hasPermi('eden-webscoket:message:remove')}]];
    var prefix = ctx + "eden-webscoket/message";

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "消息",
            columns: [{
                checkbox: true
            },
                {
                    field: 'msgId',
                    title: '消息id,自增长',
                    visible: false
                },
                {
                    field: 'msgType',
                    title: '类型 1：文字；2：图片;3：音频；4：文件；5位置；'
                },
                {
                    field: 'toUserLoginName',
                    title: '消息接收人登录名称'
                },
                {
                    field: 'toUserName',
                    title: '消息接收人名称'
                },
                {
                    field: 'content',
                    title: '消息格式【发信人ID：内容】'
                },
                {
                    field: 'fromUserLoginName',
                    title: '消息发送人登录名称'
                },
                {
                    field: 'fromAvatar',
                    title: '发送者头像地址'
                },
                {
                    field: 'fromUserName',
                    title: '消息发送人名称'
                },
                {
                    field: 'msgStatus',
                    title: '消息状态：0：未读；1：已读'
                },
                {
                    field: 'voiceTime',
                    title: '录音时长'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.msgId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.msgId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>